package com.wwl.cms.utils.designModeTest.mediator.smarthouse;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/26 17:01
 * @description:
 */
public class CoffeeMachine extends Colleague {
    public CoffeeMachine(Mediator mediator, String name) {
        super(mediator, name);
        mediator.Register(name,this);
    }

    @Override
    public void SendMessage(int stateChange){
        this.GetMediator().GetMessage(stateChange,this.name);
    }

    public void StartCoffee(){
        System.out.println("It's time to startcoffee!");
    }
    public void FinishCoffee(){
        System.out.println("After 5 minutes");
        System.out.println("Coffee is ok");
        SendMessage(0);
    }
}
